#ifndef UDPTHREAD_H
#define UDPTHREAD_H

#include <QObject>
#include <QUdpSocket>
#include <QThread>

class UdpThread : public QThread
{
    Q_OBJECT
public:
    explicit UdpThread(QObject *parent = nullptr);
    void run() override;
    void sendMessage(const QByteArray &message, const QHostAddress &address, quint16 port);

signals:
    void messageReceived(const QByteArray &message, const QHostAddress &address, quint16 port);

private:
    QUdpSocket *udpSocket;
};

#endif // UDPTHREAD_H
